<script>
    function logout() {
        swal({
                    title              : "您确定要退出登录？",
                    text               : "",
                    type               : "warning",
                    showCancelButton   : true,
                    confirmButtonColor : "#DD6B55",
                    confirmButtonText  : "注销",
                    cancelButtonText   : "取消",
                    closeOnConfirm     : false,
                    showLoaderOnConfirm: true
                },
                function () {
                    location.href = '${ctxPath}/shiro/logout';
                });
    }
</script>
<nav class="navbar navbar-inverse">
    <div class="container-fluid">
        <!-- 屏幕缩小到一定范围，菜单隐藏，这个按钮会在右上角出现 -->
        <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false" aria-haspopup="true">
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
        </button>
        
        <div class="navbar-header">
            <a class="navbar-brand" href="${ctxPath}/shiro/main">权限管理</a>
        </div>
        
        <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
            <ul class="nav navbar-nav">
                <li class="dropdown">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">资源管理 <span class="caret"></span></a>
                    <ul class="dropdown-menu">
                        <li><a href="${ctxPath}/shiro/resource/list">资源列表</a></li>
                        <li role="separator" class="divider"></li>
                        <li><a href="${ctxPath}/shiro/resource/insert">新增资源</a></li>
                    </ul>
                </li>
                <li class="dropdown">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">角色管理 <span class="caret"></span></a>
                    <ul class="dropdown-menu">
                        <li><a href="${ctxPath}/shiro/role/list">角色列表</a></li>
                        <li role="separator" class="divider"></li>
                        <li><a href="${ctxPath}/shiro/role/insert">新增角色</a></li>
                    </ul>
                </li>
                <li class="dropdown">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">用户管理 <span class="caret"></span></a>
                    <ul class="dropdown-menu">
                        <li><a href="${ctxPath}/shiro/user/list">用户列表</a></li>
                        <li role="separator" class="divider"></li>
                        <li><a href="${ctxPath}/shiro/user/insert">新增用户</a></li>
                    </ul>
                </li>
            </ul>
            
            <ul class="nav navbar-nav navbar-right">
                <li class="dropdown">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Monitor <span class="caret"></span></a>
                    <ul class="dropdown-menu">
                        <li><a href="${ctxPath}/druid" target="_blank">Druid Monitor</a></li>
                        <li role="separator" class="divider"></li>
                        <li><a href="${ctxPath}/monitoring" target="_blank">JavaMelody Monitor</a></li>
                        <li role="separator" class="divider"></li>
                        <li><a href="${ctxPath}/shiro/session/list">Shiro Session Monitor</a></li>
                    </ul>
                </li>
                <li><a href="javascript:void(0);" onclick="logout();">注销</a></li>
            </ul>
        </div>
    </div>
</nav>